import java.util.Scanner;

public class Main{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        boolean flg = false;
        int[] array = new int[200];
        int k = 0;
        for (int i = 3;i <= n;i++) {
            flg = false;
            for (int j = 2;j < i;j++) {
                if(i % j == 0) {
                    flg = true;
                    break;
                }
            }
            if(flg == false) {
                array[k++] = i;
            }
        }
        int a = n - array[k];
        int b = array[k];
        System.out.println(a);
        System.out.println(b);
    }
}
